package com.xxx.meter.ui.main.custom;

import android.app.Activity;

import com.journeyapps.barcodescanner.BarcodeResult;
import com.journeyapps.barcodescanner.CaptureManager;
import com.journeyapps.barcodescanner.DecoratedBarcodeView;

public class MyCaptureManager extends CaptureManager {

    @Override
    protected void returnResult(BarcodeResult rawResult) {
        super.returnResult(rawResult);
//        try {
//            MachineTypeBean machineBean = new Gson().fromJson(rawResult.toString(), MachineTypeBean.class);
//            if (machineBean.getId() == null || machineBean.getId().equals("")) {
//                ToastUtil.showToast("扫描的不是机器");
//            } else {
//                ToastUtil.showToast("扫描的不是机器");
//            }
//            super.returnResult(rawResult);
//        } catch (Exception e) {
//            ToastUtil.showToast("扫描的不是机器");
//        }
    }

    public MyCaptureManager(Activity activity, DecoratedBarcodeView barcodeView) {
        super(activity, barcodeView);
    }
}
